﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views {
    import flash.events.*;
    import reprise.controls.*;
    import net.wooga.pets.loading.vos.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class TestButtonsMediator extends Mediator {

		[Inject]
        public var component:LabelButton;

        override public function onRegister():void{
            eventMap.mapListener(this.component, MouseEvent.CLICK, this.component_click);
        }
        private function component_click(_arg1:MouseEvent):void{
            var _local3:RequestEvent;
            _arg1.stopPropagation();
            if (((!((String(_arg1.target).indexOf("Sun") == -1))) || (!((String(_arg1.target).indexOf("Computer") == -1))))){
                return;
            };
            var _local2:LabelButton = LabelButton(_arg1.target);
            if (_local2.hasCSSClass("cheatButton")){
                _local3 = new RequestEvent(EventConstants.SEND_REQUEST, this.onReset);
                _local3.addRequest("reset_game", {savepoint:_local2.data()});
                dispatch(_local3);
            };
        }
        private function onReset(_arg1:ResultVO):void{
            var _local2:InfoEvent = new InfoEvent(EventConstants.CALL_EXTERNAL, ProtocolConstants.RELOAD_GAME);
            dispatch(_local2);
        }
        public function updateAction(_arg1:String="some text"):void{
            if (this.component.hasCSSClass("actionDescription")){
                this.component.setLabel(_arg1);
            };
        }

    }
}//package net.wooga.pets.views 
